package sample.model;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import java.util.ResourceBundle;


/**
 * addby@wutc 20210316
 * 读取工具初始配置，使用 properties 配置
 *
 */

public class GetBaseConf {
    private Properties properties = new Properties();

    private void readBaseConf(String path) throws IOException {
            //基于 InputStream 读取配置文件
            // 使用InPutStream流读取properties文件
            BufferedReader bufferedReader = new BufferedReader(new FileReader(path));
            properties.load(bufferedReader);
            // 获取key对应的value值
            //String key = properties.getProperty("nmonPath");
            bufferedReader.close();
    }

    public Properties getProperties(String path) throws IOException {
        readBaseConf(path);
        return properties;
    }


}
